package sz.szsmk.citizencard.ui.newversion.activity

import android.os.Bundle
import androidx.fragment.app.Fragment
import com.chenenyu.router.annotation.Route
import com.gyf.immersionbar.ktx.immersionBar
import kotlinx.android.synthetic.main.discount_coupon_main.*
import sz.szsmk.citizencard.R
import sz.szsmk.citizencard.ui.adapter.CardListFragmentAdapter
import sz.szsmk.citizencard.ui.dzsmkavtivity.AppBaseActivity
import sz.szsmk.citizencard.ui.fragment.CouponOverdueFragment
import sz.szsmk.citizencard.ui.fragment.CouponToUseFragment
import sz.szsmk.citizencard.ui.newversion.fragment.CouponUsedFragment
import sz.szsmk.citizencard.ui.newversion.config.Constants
import java.util.*

/**
 * @ClassName: DiscountCouponListActivity
 * @Description:
 * @Author: Clark
 * @Date: 2020/10/12
 */
@Route(Constants.COUPONLISTACTIVITY)
class CouponListActivity : AppBaseActivity(){

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.discount_coupon_main)

        immersionBar{
            reset()
            statusBarColor(R.color.color_2184FA)
            fitsSystemWindows(true)  //使用该属性,必须指定状态栏颜色
            statusBarDarkFont(true)
        }
        initViews()
    }

    fun initViews() {
        val mFragments: MutableList<Fragment> = ArrayList()
        mFragments.add(CouponUsedFragment())
        mFragments.add(CouponToUseFragment())
        mFragments.add(CouponOverdueFragment())
        val cardListFragmentAdapter = CardListFragmentAdapter(this, mFragments, supportFragmentManager)
          vp_coupon.adapter = cardListFragmentAdapter
        val mFilter = arrayOf(
                getString(R.string.used),
                getString(R.string.to_use),
                getString(R.string.overdue))
          stl_couponBar.setViewPager(vp_coupon, mFilter)
    }

    override fun getTopTitle() = null
}